package com.example.random_clap.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.random_clap.entity.Problem;
import com.example.random_clap.mapper.EvaluateMapper;
import com.example.random_clap.mapper.ProblemMapper;
import com.example.random_clap.service.ProblemService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 问题模块业务层实现类
 *
 * @author ouyangkai
 * @date 2022-10-29
 */
@Service
public class ProblemServiceImpl extends ServiceImpl<ProblemMapper,Problem> implements ProblemService {
    @Autowired
    private ProblemMapper problemMapper;
    /**
     * 分页获取未评价的问题
     * @return
     */
    @Override
    public Page<Problem> getNoEvaluateProblem(int currentPage, int pageSize, Long userId,int status) {
        PageHelper.startPage(currentPage,pageSize);
        Page<Problem> pageInfo = problemMapper.getNoEvaluateProblem(userId,status);

        return pageInfo;
    }
}
